import { requestClient } from '#/api/request';

export namespace Workorder {
  export interface Params {
    attr1: null;
  }
  export interface Row {
    searchValue: null;
    createBy: string;
    createTime: Date;
    updateBy: string;
    updateTime: Date;
    remark: string;
    params: Params;
    parentName: null;
    parentId: number;
    orderNum: null;
    ancestors: string;
    children: any[];
    workorderId: number;
    workorderCode: string;
    workorderName: string;
    workorderType: string;
    orderSource: string;
    sourceCode: string;
    productId: number;
    productCode: string;
    productName: string;
    productSpc: string;
    unitOfMeasure: string;
    unitName: string;
    batchCode: null;
    quantity: number;
    quantityProduced: number;
    quantityChanged: null;
    quantityScheduled: null;
    clientId: number;
    clientCode: string;
    clientName: string;
    vendorId: null;
    vendorCode: null;
    vendorName: null;
    requestDate: Date;
    finishDate: null;
    status: string;
    attr2: null;
    attr3: number;
    attr4: number;
    tasks: null;
    attr1: boolean | null | string;
  }
  export interface GetListParams {
    pageNum: number;
    pageSize: number;
  }
  export interface GetListReturn {
    total: number;
    rows: Row[];
    code: number;
    msg: string;
  }
}
``;

// 获取列表
export const getWorkorderTableList = (params: Workorder.GetListParams) =>
  requestClient.get<Workorder.GetListReturn>('/mes/pro/workorder/list', {
    params,
  });
